package cn.com.shinho.hg.gate.consumer;

import cn.com.shinho.hg.core.base.response.ResponseData;
import cn.com.shinho.hg.core.constant.Constant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 消息服务消费者
 *
 * @author Mr.Ye
 * @Date 2018-7-09-下午7:52
 */
@FeignClient(name=Constant.AUTH_MODULAR_NAME)
@RequestMapping("/api/authService")
public interface AuthServiceConsumer{

    /**
     * 根据用户id获取用户信息
     *
     * @author Mr.Ye
     */
    @GetMapping("/getUser/{userId}")
    @ResponseBody
    ResponseData getUserById(@PathVariable("userId") Long userId);

    /**
     * 获取用户的权限路径
     *
     * @author Mr.Ye
     */
    @GetMapping("/getPermissionUrls/{userId}")
    @ResponseBody
    ResponseData getUserPermissionUrls(@PathVariable("userId") Long userId);

    /**
     * 通过appId获取secret
     *
     * @author Mr.Ye
     */
    @GetMapping("/getSecret/{appId}")
    @ResponseBody
    ResponseData getSecretByAppId(@PathVariable("appId") String appId);

}
